package com.jmb.api;

import com.jmb.po.UserInformation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Component
@FeignClient("userInfo-producer")
public interface AdminApi {

    @RequestMapping(value = "/getByTel" , method = RequestMethod.GET)
    public UserInformation findByTel(String tel);

    @RequestMapping(value = "/getById" , method = RequestMethod.GET)
    public UserInformation findById(int id);

    @RequestMapping(value = "/all" , method = RequestMethod.GET)
    public List<UserInformation> findAll();

    @RequestMapping(value = "/up" , method = RequestMethod.PUT)
    public boolean update(@RequestBody UserInformation user);

    @RequestMapping(value = "/add" , method = RequestMethod.POST)
    public boolean add(@RequestBody UserInformation user);

    @RequestMapping(value = "/del" , method = RequestMethod.DELETE)
    public boolean del(String tel);

}
